// VBConversions Note: VB project level imports
using System.Collections.Generic;
using System;
using System.Linq;
using System.Drawing;
using System.Diagnostics;
using Microsoft.VisualBasic;
using System.Xml.Linq;
using Microsoft.VisualBasic.Compatibility;
using System.Windows.Forms;
using System.Collections;
using System.Data;
// End of VB project level imports

using System.IO;

namespace 喷码数据生成工具
{
	public partial class frmJanpanEMS
	{
		public frmJanpanEMS()
		{
			InitializeComponent();
		}
		CheckCode CheckBar = new CheckCode();
		public void frmJanpanEMS_Load(object sender, EventArgs e)
		{
			
		}
		
		public void Btn_Create_Click(object sender, EventArgs e)
		{
			long StartNo = 28558801;
			long EndNo = 28838800;
			FileStream fs = new FileStream("E:\\1.TXT", FileMode.Create);
			StreamWriter fw = new StreamWriter(fs, System.Text.Encoding.Default);
			long sIndex = 0;
			for (var i = StartNo; i <= EndNo; i++)
			{
				string tmpW = "EJ" + i.ToString() + CheckBar.ModEleven(i.ToString()) + "JP";
				string LineTwo = Form1.Default.InsertChar("*" + tmpW + "*", "   ");
				fw.WriteLine(tmpW);
				fw.WriteLine(LineTwo);
				sIndex++;
				if (sIndex % 50000 == 0 & sIndex > 0)
				{
					for (var j = 1; j <= 500; j++)
					{
						fw.WriteLine("EJ" + CommFunction.FormatByLength(j, 9) + "JP");
						fw.WriteLine(Form1.Default.InsertChar("*EJ" + CommFunction.FormatByLength(System.Convert.ToInt64(j), 9) + "JP*", "   "));
					}
				}
				this.Text = Strings.Format(System.Convert.ToInt32(sIndex / System.Convert.ToInt32(System.Convert.ToInt32(EndNo - StartNo) + 1)) * 100, "00") + "%";
				(new Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase()).DoEvents();
			}
			fw.Close();
			fs.Close();
		}
		
	}
}
